<%@ page import="java.util.Vector" %>
<%@ page import="com.entity.Diagnose" %>
<%@ page import="com.entity.Doctor" %>
<%@ page import="com.service.DoctorService" %>
<%@ page import="com.entity.Patient" %>
<%@ page import="com.service.PatientService" %><%--
  Created by IntelliJ IDEA.
  User: 95241
  Date: 2021/9/22
  Time: 20:59
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>诊断记录</title>

    <link rel="stylesheet" type="text/css" href="css/deal.css">
</head>
<body style="background-color: #EBECF0">
<br>
<br>

<h2 style="margin-left: 15%">诊断记录</h2>
<br>

<hr align=center width="70%" SIZE=3>
<br>
<br>

<center>
<table border="1" cellspacing="0" width=70% cellpadding="20" >
    <tr bgcolor="#a9a9a9">
        <th align="center">编号</th>
        <th align="center">姓名</th>
        <th align="center">性别</th>
        <th align="center">科室</th>
        <th align="center">医生</th>
        <th align="center">病情</th>
        <th align="center">日期</th>
    </tr>

    <%
        Vector<Diagnose> diagnoses = (Vector<Diagnose>) request.getAttribute("patientDiagnoses");
        Diagnose diagnose;
        DoctorService doctorService = new DoctorService();
        PatientService patientService = new PatientService();
        if(diagnoses!=null){
            int size = diagnoses.size();
            while (size>0){
                diagnose = diagnoses.get(size-1);
                Doctor doctor = doctorService.findThisDoctor(diagnose.getWorkId());
                Patient patient = patientService.findThisPatient(diagnose.getPatientAccount());
                if(diagnose!=null){
                    %>
                    <tr>
                        <td align="center"><%=diagnose.getId()%></td>
                        <td align="center"><%=patient.getName()%></td>
                        <td align="center"><%=patient.getSexString()%></td>
                        <td align="center"><%=doctor.getDepartment()%></td>
                        <td align="center"><%=doctor.getName()%></td>
                        <td align="center"><%=diagnose.getIllness()%></td>
                        <td align="center"><%=diagnose.getSignDate()%></td>
                    </tr>
    <%
                    //System.out.println(diagnose.getSignDate());
                }
                size-=1;
            }
        }

    %>


</table>

    <br>
    <br>
    <a href="patientServlet?operation=homePage"><input type="button" value="返回" class="sub"></a>
</center>
</body>
</html>
